home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Tele / Telefinder / Group Edition AE's / THINK C Interfaces / User Manager AE / UserFile.h < prev   
Encoding:
C/C++ Source or Header  |  1993-12-14  |  5.9 KB  |  216 lines  |  [TEXT/KAHL]

  1.  
  2. #ifndef    _UserManager_
  3. #define _UserManager_
  4.  
  5. #include <Lists.h>
  6. #include <SerialMgr.h>
  7.  
  8. /* 
  9.  
  10. © 1988-1992 Spider Island Software
  11.  
  12. file definition of TeleUsers file
  13.  
  14. for TeleFinder Group Edition version 2.6 
  15. note: all strings are stored in pascal format
  16.  
  17. KEY:
  18.  
  19. < field modified by user manager.
  20. > field modified by Group Edition Host    
  21.  
  22. */
  23.  
  24. #define STREET_MAX        50
  25. #define CITY_MAX        15
  26. #define STATE_MAX        2
  27. #define ZIP_MAX            10
  28. #define V_PHONE_MAX        20
  29. #define U_NAME_MAX        32
  30. #define PW_MAX            10
  31. #define DIALBACK_MAX    40
  32. #define PATH_MAX        255
  33.  
  34. typedef struct
  35. {
  36.     Byte        UserName[U_NAME_MAX];        /* <     user's logon name */
  37.     long        UserID;                        /* <     unused         */
  38.     Byte        Password[PW_MAX];            /* <>     user's password */
  39.     Byte        MailPath[256];                /* <      full path to the user's mail folder    */        
  40.     unsigned    PrivFlags;                    /* <      bitmap field    */
  41.     unsigned    DOSFlags;                    /* <      bitmap field    */
  42.     int            MaxTime;                    /* <>    maximum time allowed            */
  43.     int            LogonsPerDay;                /* <      how many times allowed per day      */
  44.     int            LogonsToday;                /* <>    how many times logged on today */
  45.     int            LogonsMax;                    /* <>     == Time logged on today */
  46.     int            MaxIsDaily;                    /* <     time limit type      */
  47.     long        LastDay;                    /* <>     record time stamp when the day of last logon changes    */
  48.     unsigned    Priv2Flags;                    /* <     bitmap field added 4/25/90 2 bytes removed from spare_entries    */
  49.     int            totalCalls;                    /* <>     total calls made to the BBS     */
  50.     long        totalTime;                    /* <>     total time logged on to the BBS     */
  51.     Byte        DialBackStr[DIALBACK_MAX];    /* <      phone number to dial back at        */
  52.     long        lastPWchange;                /* <>     when user last changed his password    */
  53.     long        lastUpdate;                    /* <>     time of last logon                    */
  54.     Byte        AccessFName[32];            /* <      named of file containing users access paths */
  55.     long        kb_uploaded;                /* <>     kb's uploaded by user    */
  56.     long        kb_downloaded;                /* <>     kb's downloaded by user */
  57.     long        email_sent;                    /* <>     number of email messages sent by user    */
  58.     long        msgs_posted;                /* <>     number of messages posted by user    */
  59.     long        expire_date;                /* <    date to expire a user record */
  60.     int            nextSessionTimeAllowed;        /* >    calc's by UM AEGetUser, time permitted for next logon    */
  61.     int            dailyMaximumAllowed;        /* >    calc's by UM AEGetUser, time permitted for next logon    */
  62.     Byte        spares[70];                    /*         reserved    */
  63.     Byte        spareb;                        /*         reserved    */
  64.     Byte        VoicePhone[V_PHONE_MAX+1];    /* <      users voice phone number            */
  65.     long        DirID;                        /*         unused                                */
  66.     int            vRef;                        /*         unused                                */
  67. } UserRecord, *UserRecPtr, **UserRecHdl;
  68.  
  69.     
  70. typedef struct
  71. {
  72.     Byte    version;
  73.     long    RecSize;
  74.     long    NumRecs;
  75.     int        modified;
  76. }    UserFileHdr;
  77.  
  78.  
  79. typedef struct
  80. {
  81.     UserFileHdr    FileHeader;
  82.     Byte        fName[65];
  83.     int            vRef;
  84.     long        DirID;
  85.     UserRecHdl    Records[];
  86. }    UserData, *UserPtr, **UserHandle;
  87.  
  88.  
  89. typedef struct
  90. {
  91.     Byte        UserName[U_NAME_MAX];        /* user's logon name */
  92. } ListUserRecord, *ListUserRecPtr, **ListUserRecHdl;
  93.  
  94.  
  95. typedef struct
  96. {
  97.     UserFileHdr        FileHeader;
  98.     Byte            fName[65];
  99.     int                vRef;
  100.     long            DirID;
  101.     ListUserRecHdl    Records[];
  102. } ListUserData, *ListUserPtr, **ListUserHandle;
  103.  
  104.  
  105. /*    Privelege Flags    (PrivFlags fields)        */
  106. #define    SysOpFlag         0x0001    // all files access
  107. #define    DownLoadFlag     0x0002
  108. #define    TimeLimitFlag     0x0004
  109. #define    ExtAccess         0x0008
  110.  
  111. #define    ChPass             0x0010
  112. #define    DelMail             0x0020
  113. #define NoFiles            0x0040    
  114. #define PathA            ExtAccess
  115. #define PathB            0x0080
  116.  
  117. #define ConfAccess        0x0100
  118. #define PublName        0x0200
  119. #define PublPhone        0x0400
  120. #define OnCallBack        0x0800
  121.  
  122. #define    PathC            0x1000
  123. #define    Conf2            0x2000
  124. #define    MakeChgs        0x4000
  125. #define    CannotUpload    0x8000
  126.  
  127. /*    Privelege Flags ( Priv2Flags field )     */
  128. #define    PathD                0x0001
  129. #define    Conf3                0x0002
  130. #define    PathE                0x0004
  131. #define    Conf4                0x0008
  132. #define    Conf5                0x0010
  133.  
  134. #define    DLIsTimeLimited        0x0020
  135. #define    kCanEditSettings    0x0040
  136. #define    kPermanentUserFlag    0x0080
  137.  
  138. /*    DOS preferences    */
  139. #define    useMacBinary     0x0001
  140. #define    useCRC             0x0002
  141.     
  142.     
  143.  
  144. /*    Password errors    */
  145. enum    {
  146.     
  147.     noPassErr,
  148.     PassNotFound,
  149.     invalidPW,
  150.     PassDiskErr,
  151.     PassPrivErr
  152.     
  153.     };
  154.  
  155. /*    TIME LIMIT OPTIONS    (MaxIsDaily field)    */
  156. enum    {
  157.     DAILY,
  158.     EACH_LOGON,
  159.     NO_USER_TIME_LIMIT,
  160.     ABSOLUTE_TIME
  161.     };
  162.  
  163. #define    _1_MINUTE_     60L
  164. #define _1_HOUR_    (_1_MINUTE_*60L )
  165. #define    _24_HOURS_     (_1_HOUR_*24L )
  166.  
  167.  
  168. #define _num_day( _time_secs ) ((unsigned long)_time_secs/_24_HOURS_ )
  169. #define _num_hrs( _time_secs ) ((unsigned long)_time_secs/_1_HOUR_ )
  170. #define _num_hrs_mins( _time_secs ) ((unsigned long)_time_secs/_1_MINUTE_ )
  171.  
  172.  
  173. UserHandle    GetUsers();
  174. UserRecHdl    CellToUser(), ReadRecordNum();
  175. Cell        GetActiveCell();
  176. long GetULogonTime(SIO *SIOptr);
  177. int SaveULogonTime(SIO *SIOptr);
  178. unsigned long GetLastLogon(SIO *SIOptr);
  179. int CheckLastLogon(SIO *SIOptr);
  180. int GetLogonsPerDay(SIO *SIOptr);
  181. int GetLogonsToday(SIO *SIOptr);
  182. int UpdateULogonTime(SIO *SIOptr);
  183. int ShowULogonTime(SIO *SIOptr, int log);
  184. int UpdateUPass(SIO *SIOptr, Byte *password);
  185. int SendPassErrMsg(SIO *SIOptr, int PassErr);
  186. int SetUserTimeToday(SIO *SIOptr, int today_total);
  187. int GetMaxUserTime(SIO *SIOptr);
  188. int GetUserTime(SIO *SIOptr);
  189. int CanUserChPass(SIO *SIOptr);
  190. int GetUserName(SIO *SIOptr, Byte *theStr);
  191. int CanUserDelMail(SIO *SIOptr);
  192. int CanUserMakeChange(SIO *SIOptr);
  193. int CallUser(SIO *SIOptr);
  194. int IsUserCallBack(SIO *SIOptr);
  195. int CanUserDownLoad(SIO *SIOptr, CInfoPBRec *myPB);
  196. int SendTUserList(SIO *SIOptr, Byte *uName);
  197. int SendUserInfo(SIO *SIOptr, UserRecHdl theUser);
  198. UserRecHdl FindPartialUser(Byte *toFind, int *StartAt, int fRefNum, int NumRecs);
  199. int PBCanTheyDelThis(SIO *SIOptr, HParamBlockRec *theParam);
  200. int PBCmdPathType(SIO *SIOptr, HParamBlockRec *theParam, int *flags );
  201. int SetUserDir(SIO *SIOptr, long DirID);
  202. long UserDirectory(SIO *SIOptr);
  203. int SetUserVol(SIO *SIOptr, int vRef);
  204. int UserVol(SIO *SIOptr);
  205. void AddToUserDLKb( SIO* SIOptr, long k_bytes );
  206. void AddToUserULKb( SIO* SIOptr, long k_bytes );
  207. void AddToUserMsgsSent( SIO* SIOptr, long msg_sent );
  208. void AddToUserMailSent( SIO* SIOptr, long email_sent );
  209.  
  210. int CanUserUpload(SIO *SIOptr );
  211. int IsUserDLTimeLimit(SIO *SIOptr );
  212. int IsUserAllFiles(SIO *SIOptr);
  213. int IsUserName( SIO* SIOptr, Byte* name );
  214.  
  215. #endif
  216.